package com.tlgen.service;

import com.tlgen.mapper.BasicLaborMapper;
import com.tlgen.model.BasicLabor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author: tlgen
 * @Discription:
 */
@Service
public class BasicLaborService {

    @Autowired
    BasicLaborMapper basicLaborMapper;

    public List<BasicLabor> getAllBasicLabors() {
        return basicLaborMapper.getAllBasicLabors();
    }

    public Integer addBasicLabor(BasicLabor BasicLabor) {
        BasicLabor.setCreateDate(new Date());
        BasicLabor.setEnabled(true);
        return basicLaborMapper.insertSelective(BasicLabor);
    }

    public Integer updateBasicLabor(BasicLabor BasicLabor) {
        return basicLaborMapper.updateByPrimaryKeySelective(BasicLabor);
    }

    public Integer deleteBasicLaborById(Integer id) {
        return basicLaborMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteBasicLaborByIds(Integer[] ids) {
        return basicLaborMapper.deleteBasicLaborByIds(ids);
    }
}
